<?php

use Illuminate\Database\Schema\Blueprint;

class CreateCodes extends \App\Utils\CreateMigration
{

    function columns(Blueprint $table)
    {
        $table->string('name', 50)->nullable()->comment('名称');
        $table->char('code', 20)->nullable()->comment('编码');
        $table->string('desc')->nullable()->comment('备注');
        $table->index(['deleted_at', 'code'], 'index_deleted_code');
        $table->unique(['deleted_at', 'code'], 'unique_deleted_code');
    }

    function tableInfo()
    {
        return ['codes','系统编码'];
    }
}
